#include <bits/stdc++.h>

using namespace std;

template<typename T> inline void read(T &x){
	T s = 0, f = 1; char ch = getchar();
	while(!isdigit(ch)) f = (ch == '-' ? -1 : 1), ch = getchar();
	while(isdigit(ch)) s = (s << 1) + (s << 3) + (ch ^ 48), ch = getchar();
	x = s * f;
}

const int N = 1e5 + 10;
int n, m;
int a_[N], a[N], c[N];

int main(){
	freopen("arena.in", "r", stdin);
	freopen("arena.out", "w", stdout);
	cin >> n >> m;
	for(int i = 1;i <= n;i ++){
		cin >> a_[i];
	}
	for(int i = 1;i <= m;i ++){
		cin >> c[i];
	}
	int k = ceil(log2(n));
	cout << k << endl;
	while(k --){
		string s;
		cin >> s;
	}
	int T; cin >> T;
	while(T --) cout << 1 << endl;
	return 0;
}
